package removeifelse;

/**
 * TODO:类描述
 *
 * @className: Test2
 * @packageName: removeifelse
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/5/4 21:32
 */
public class Test2 {
    @Deprecated
    private String a(int input) {
        String retStr = "";
        if (input == 0) {
            retStr = "male";
        } else if (input == 1) {
            retStr = "woman";
        } else {
            retStr = "unknow";
        }
        return retStr;
    }

    private String b(int input) {
        if (input == 0) return "male";
        if (input == 1) return "woman";
        return "unkonw";
    }

    private String c(int input) {
        if (input < 0) throw new IllegalArgumentException();
        if (input > 1) throw new IllegalArgumentException();
        return input == 0 ? "male" : "woman";
    }

    public static void main(String[] args) {

    }
}
